﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using A2DFramework.EventService;
using A2DFramework.InstanceService;
using TestEvent_Base;
using System.Threading;

namespace Event_Pub
{
    class Program
    {
        static void Main(string[] args)
        {
            A2DFramework.Starter.Init();
            A2DFramework.QueueService.Starter.Init();
            A2DFramework.EventService.Starter.Init();

            IEventBus evtBus = ObjectFactory.Resolve<IEventBus>();

            Console.WriteLine("Event_Pub OK, ready publish event.");

            TestEvent evt = new TestEvent();
            

            int i = 0;
            while (true)
            {
                i++;
                evt.Temp = DateTime.Now.ToString();
                evtBus.Publish<TestEvent>(evt);
                Console.WriteLine(i);
            }

            Console.WriteLine("done.");

            Console.ReadKey();
        }
    }
}
